# UDP协议 套接字客户端
import socket

# UDP协议=>数据报协议  socket.SOCK_DGRAM
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

while True:
    msg = input('输入》》》:')
    client.sendto(msg.encode('utf-8'),('127.0.0.1', 8081))
    data,addr= client.recvfrom(1024)
    print(data.decode('utf-8'))

client.close()
